home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-20 | 3.5 KB | 72 lines | [TEXT/MMCC] |
- // =================================================================================
- // SliderCDEF.h ©1993-1994 Harold Ekstrom. All rights reserved.
- // =================================================================================
-
- #pragma once
-
- #ifndef __QDOFFSCREEN__
- #include <QDOffscreen.h>
- #endif
-
- // This structure will be allocated during initialization, and
- // a handle to it will be stored in the contrlData field of the
- // control record.
- typedef struct {
- GWorldPtr sdTrack;
- GWorldPtr sdThumb;
- Rect sdTrackBounds;
- Rect sdThumbBounds;
- short sdPosition;
- short sdDepth;
- short sdVarCode;
- } SliderData, *SliderDataPtr, **SliderDataHnd;
-
- // Drawing constants.
- #define kStdThumbSize (40)
- #define kStdFont (geneva)
- #define kStdFontSize (9)
- #define kStdFontFace (0)
- #define kThumbShade (4)
-
- // Variation codes. These can be added together to make up
- // the variation code for the control, but the variations using
- // the title should be used exclusively.
- #define kValueAboveCtl ((short)0x0001)
- #define kTitleAfterValue ((short)0x0002)
- #define kTitleBeforeValue ((short)0x0004)
- #define kTitleInTrack ((short)0x0008) // Only for horizontal sliders.
-
- // Macros.
- #define GetSliderData(slider) ((SliderDataHnd) (**slider).contrlData)
- #define IsSliderActive(slider) (((**slider).contrlHilite == 255) ? false : true)
-
- // Prototypes.
- pascal long SliderCDEF( short inVarCode, ControlHandle inControl, short inMessage, long inParam );
- void SliderDrawControl( short inVarCode, ControlHandle inControl, long inParam );
- pascal void SliderBlitControl( short inDepth, short inDeviceFlags, GDHandle inTargetDevice, long inUserData );
- pascal void SliderDrawParts( short inDepth, short inDeviceFlags, GDHandle inTargetDevice, long inUserData );
- void SliderDrawTrack( short inDepth, ControlHandle inControl );
- void SliderDrawThumb( short inDepth, ControlHandle inControl );
- pascal void SliderDrawValue( short inDepth, short inDeviceFlags, GDHandle inTargetDevice, long inUserData );
- long SliderTestControl( short inVarCode, ControlHandle inControl, long inParam );
- void SliderCalcCRgns( short inVarCode, ControlHandle inControl, long inParam );
- void SliderInitControl( short inVarCode, ControlHandle inControl, long inParam );
- OSErr SliderCreateOffscreenWorld( ControlHandle theControl );
- void SliderDisposeControl( short inVarCode, ControlHandle inControl, long inParam );
- void SliderPositionControl( short inVarCode, ControlHandle inControl, long inParam );
- void SliderThumbControl( short inVarCode, ControlHandle inControl, long inParam );
- long SliderDragControl( short inVarCode, ControlHandle inControl, long inParam );
- void SliderAutoTrack( short inVarCode, ControlHandle inControl, long inParam );
- void SliderCalcCntlRgn( short inVarCode, ControlHandle inControl, long inParam );
- void SliderCalcThumbRgn( short inVarCode, ControlHandle inControl, long inParam );
- short CalcPosition( ControlHandle inControl );
- void CalcDragRect( ControlHandle inControl, Rect *outRect );
- void CalcTrackRect( ControlHandle inControl, Rect *outRect );
- void CalcThumbRect( ControlHandle inControl, Rect *outRect );
- Boolean IsHorizontal( ControlHandle theControl );
- short GetDepth( ControlHandle theControl );
- void MixColors( const RGBColor *inLight, const RGBColor *inDark, short inShade, RGBColor *outResult );
- StringPtr CopyPStr( ConstStr255Param inSourceStr, Str255 outDestStr );
- StringPtr ConcatPStr( Str255 ioFirstStr, ConstStr255Param inSecondStr );
- StringPtr PrefixPStr( Str255 ioFirstStr, ConstStr255Param inSecondStr );
-